/**
 * 
 */
package cc.dogtailflower.framework.handler;

import java.util.Properties;

import cc.dogtailflower.framework.constant.Configuration;
import cc.dogtailflower.framework.util.PropsUtil;

/**
 * 属性文件处理类
 * @author cc
 *
 */
public class ConfigHandler {

	//加载配置文件
	private static final Properties CONFIG_PROPS = PropsUtil.loadProps(Configuration.CONFIG_FILE);
	
	//获取jdbc driver
	public static String getJdbrDriver(){
		return PropsUtil.getString(CONFIG_PROPS, Configuration.JDBC_DIRVER);
	}
	
	//获取jdbc url
	public static String getJdbcUrl(){
		return PropsUtil.getString(CONFIG_PROPS, Configuration.JDBC_URL);
	}
	
	//获取基础包名
	public static String getBasePackage(){
		return PropsUtil.getString(CONFIG_PROPS, Configuration.BASE_BACKAGE);
	}
	
	//获取视图路径
	public static String getViewPath(){
		return PropsUtil.getString(CONFIG_PROPS,Configuration.VIEW_PATH,"/WEB-INF/view/");
	}
	
	//静态资源路径
	public static String getAssetPath(){
		return PropsUtil.getString(CONFIG_PROPS, Configuration.ASSET_PATH,"/asset/");
	}
	
}
